<template>
    <div>
      <h1 @click="changeCity('北京')">北京</h1>
      <h1 @click="changeCity('上海')">上海</h1>
    </div>
</template>

<script>
  import {mapMutations} from 'vuex'
    export default {
        name: "City",
      methods:{
          changeCity(city){
            this.changeAddress(city)
            this.$router.push('/')
          },
          ...mapMutations(['changeAdress'])
      }
    }
</script>

<style scoped>

</style>
